﻿using Microsoft.AspNetCore.SignalR;

namespace DocTranslator.Hubs
{
    public class TranslationHub : Hub
    {
        // 发送进度更新
        public async Task SendProgress(string connectionId, int filecompleted, int filetotal, int grandcompleted,int grandtotal,string currentFile, string status)
        {
            await Clients.Client(connectionId).SendAsync("UpdateProgress", filecompleted, filetotal, grandcompleted, grandtotal, currentFile, status);
        }

        // 发送完成通知
        public async Task SendCompletion(string connectionId, List<string> fileNames)
        {
            await Clients.Client(connectionId).SendAsync("TranslationComplete", fileNames);
        }
    }
}
